__asm__(".code16gcc");
//实模式下
#include"boot_info"
static _boot_info_t boot_info;
static void show_msg(const char*msg){
   //内联汇编见文档
   char c;
   while((c=*msg++)!='\0')
   {
      //分配c变量给随机寄存器内
      //编译器不优化我的代码，原封不动
      __asm__ __volatile__(
         "mov $0xe, %%ah\n\t"
	      "mov %[ch], %%al\n\t"
	      "int $0x10\n\t"::[ch]"r"(c)
      );
   }
}
static void detect_meory(void){
   
   show_msg("loading memory info...");
   boot_info.ram_region_count=0;
   for(int i=0;i<BOOT_RAM_REGGIN;i++)
   {
      SMAP_entry_t smap_entry;
      SMAP_entry_t*entry=&smap_entry;
      __asm__ __volatile__ ("int $0x15"
      :"=a"(signaure),
      "=c"(bytes),
      "=b"(contID)
      :"a"(0xE820),
      "b"(contID),
      "c"(24),
      "d"(0x534D4150),"D"(entry)
      )
      if(signaure!=0x534D4150)
         return;
      if(bytes>20&&(entry->ACPI&0x0001)==0)
         continue;
      if(entry->Type==1){
         boot_info.ram_region_cfg[bootinfo.ram_region_cfg++].start=entry->BaseL;
      }

   }
}
void loader_entry(void){
   show_msg("loader_running....");
   for(;;){}
}